import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/home";

Vue.use(VueRouter);

const routes = [
    {
        path: "/details/:id",
        name: "details",
        component: () => import("../views/details"),
    },
    {
        path: "/",
        component: Home,
        children: [
            {
                path: "",
                name: "recommend",

                component: () => import("../views/recommend"),
            },
            { path: "ranking", name: "ranking", component: () => import("../views/ranking") },
            { path: "classification", name: "classification", component: () => import("../views/classification") },
        ],
    },
    {
        path: "/bookshelf",
        name: "bookshelf",
        component: () => import("../views/bookshelf"),
    },
    {
        path: "/set",
        name: "set",
        component: () => import("../views/set"),
    },
    {
        path: "/notFound",
        name: "notFound",
        component: () => import("../views/notFound"),
    },
    {
        path: "/searchList",
        name: "searchList",
        component: () => import("../views/searchList"),
    },
    {
        path: "/person",
        name: "person",
        component: () => import("../views/person"),
    },
    {
        path: "/glance",
        name: "glance",
        component: () => import("../views/glance"),
    },
    {
        path: "/login",
        name: "login",
        component: () => import("../views/login"),
    },
    {
        path: "/register",
        name: "register",
        component: () => import("../views/register"),
    },
    {
        path: "/my",
        name: "my",
        component: () => import("../views/my"),
    },
    {
        path: "/browse/:id",
        name: "browse",
        component: () => import("../views/browse"),
    },
];

const router = new VueRouter({
    routes,
});

export default router;
